package 动态数组.队列.测试;

import 动态数组.队列.ArrayDeque;

public class TestArrayDeque {
    public static void main(String[] args) {
        ArrayDeque<Integer> deque = new ArrayDeque<>();
        for (int i = 1; i <= 5; i++) {
            deque.addFirst(i);
        }
        System.out.println(deque);
        for (int i = 6; i <= 10; i++) {
            deque.addLast(i);
        }
        System.out.println(deque);
        System.out.println(deque.removeFirst());
        System.out.println(deque.removeLast());
        System.out.println(deque);
        System.out.println(deque.pop());
        System.out.println(deque.poll());
        System.out.println(deque);
        System.out.println(deque.getFirst());
        System.out.println(deque.getLast());
        System.out.println(deque+"size:" + deque.size());
        System.out.println(deque.element());
        System.out.println(deque.peek());
        System.out.println("-----------");
        for (Integer integer : deque) {
            System.out.println(integer);
        }
        System.out.println("----------------");
        ArrayDeque<Integer> deque1 = new ArrayDeque<>();
        for (int i = 1; i <= 5; i++) {
            deque1.addFirst(i);
        }
        ArrayDeque<Integer> deque2 = new ArrayDeque<>();
        for (int i = 1; i <= 5; i++) {
            deque2.addFirst(i);
        }
        deque2.pop();
        System.out.println(deque1.equals(deque2));





    }
}
